import { createApp } from 'vue';
import { createPinia } from 'pinia';
// 导入全局样式
import '@/styles/index.scss';
import App from './App.vue';
import router from './router';
// 整合ElementPlus
import ElementPlus from 'element-plus';
// @ts-ignore 忽略ts检查
import zhCn from 'element-plus/dist/locale/zh-cn.mjs';
import { useElIcon } from '@/utils/setGlobal';
import { useVxeTable } from '@/utils/vxeTable';
import './permission' // permission control
import { handleTree } from '@/utils/util'


const app = createApp(App);

app.use(createPinia());
app.use(router);
// 使用ElementPlus，并且中文
app.use(ElementPlus, {locale: zhCn});
useElIcon(app);
useVxeTable(app);

// 全局方法挂载
app.config.globalProperties.handleTree = handleTree

app.mount('#app');
